Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LBAAS-2800: no region field needed for global lb type #1046

Merged

Conversation

apinonformoso
Copy link
Contributor

@apinonformoso apinonformoso commented Oct 9, 2023

Summary

Created a custom diff function to validate that region field is not required if the type file is set to GLOBAL and if set to REGIONAL validate region value is present and not empty.

Validation

Verified by running terraform plan for each case

type=GLOBAL and region="nyc3"

Screenshot 2023-10-10 at 8 59 00

type=GLOBAL and region=""

Screenshot 2023-10-10 at 8 54 35

type=GLOBAL and no region

Screenshot 2023-10-10 at 8 59 22

type=REGIONAL and region="nyc3"

Screenshot 2023-10-10 at 8 59 57

type=REGIONAL and region=""

Screenshot 2023-10-10 at 9 04 46

type=REGIONAL and no region

Screenshot 2023-10-10 at 9 05 08

region="nyc3" and no type

Screenshot 2023-10-10 at 9 05 50

no type and no region

Screenshot 2023-10-10 at 9 06 10

@apinonformoso apinonformoso marked this pull request as ready for review October 10, 2023 14:37
@danaelhe
Copy link
Member

Looks AWESOME! Could you include some test coverage for this as well? You can include it in the /loadbalancer/resource_loadbalancer_test.go test file 👍

@apinonformoso apinonformoso changed the title fix: no region field needed for global lb type LBAAS-2800: no region field needed for global lb type Oct 10, 2023
@apinonformoso
Copy link
Contributor Author

apinonformoso commented Oct 10, 2023

Looks AWESOME! Could you include some test coverage for this as well? You can include it in the /loadbalancer/resource_loadbalancer_test.go test file 👍

@danaelhe Tests added 👍

Copy link
Member

@danaelhe danaelhe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 👍

@danaelhe danaelhe merged commit b8ba602 into digitalocean:main Oct 10, 2023
2 checks passed
@apinonformoso apinonformoso deleted the apinonformoso/no-region-for-glb branch October 10, 2023 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants